<!-- 定时任务详情弹窗 -->
<template>
  <a-form
    ref="form3"
    class="ele-form-detail"
    :model="scheduledTaskModalApp.scheduledTask"
    :label-col="{md: {span: 2}, sm: {span: 4}, xs: {span: 6}}"
    :wrapper-col="{md: {span: 22}, sm: {span: 20}, xs: {span: 18}}">
    <a-descriptions :title="scheduledTaskModalApp.title" bordered>
      <!--                                    <a-descriptions-item label="标识">-->
      <!--                        {{ scheduledTaskModalApp.scheduledTask.Eid }}-->
      <!--                    </a-descriptions-item>-->
      <!--                                    <a-descriptions-item label="创建人">-->
      <!--                        {{ scheduledTaskModalApp.scheduledTask.creatorName }}-->
      <!--                    </a-descriptions-item>-->
<!--      <a-descriptions-item label="名称">-->
<!--        {{ scheduledTaskModalApp.scheduledTask.name }}-->
<!--      </a-descriptions-item>-->
      <a-descriptions-item label="任务名称">
        {{ scheduledTaskModalApp.scheduledTask.jobName }}
      </a-descriptions-item>
      <a-descriptions-item label="任务分组">
        {{ scheduledTaskModalApp.scheduledTask.jobGroup }}
      </a-descriptions-item>
      <a-descriptions-item label="cron表达式">
        {{ scheduledTaskModalApp.scheduledTask.cron }}
      </a-descriptions-item>
      <a-descriptions-item label="接口Bean">
        {{ scheduledTaskModalApp.scheduledTask.beanName }}
      </a-descriptions-item>
      <a-descriptions-item label="方法">
        {{ scheduledTaskModalApp.scheduledTask.methodName }}
      </a-descriptions-item>
      <a-descriptions-item label="方法参数">
        {{ scheduledTaskModalApp.scheduledTask.methodParams }}
      </a-descriptions-item>
      <a-descriptions-item label="状态">
        <a-tag color="green" v-if="scheduledTaskModalApp.scheduledTask.status=='1'">正常</a-tag>
        <a-tag color="blue" v-if="scheduledTaskModalApp.scheduledTask.status=='2'">暂停</a-tag>
      </a-descriptions-item>
      <!--                                    <a-descriptions-item label="创建人ID">-->
      <!--                        {{ scheduledTaskModalApp.scheduledTask.creatorId }}-->
      <!--                    </a-descriptions-item>-->
      <!--                                    <a-descriptions-item label="备注">-->
      <!--                        {{ scheduledTaskModalApp.scheduledTask.remark }}-->
      <!--                    </a-descriptions-item>-->
      <!--                                    <a-descriptions-item label="创建时间">-->
      <!--                        {{ scheduledTaskModalApp.scheduledTask.createDatetime }}-->
      <!--                    </a-descriptions-item>-->
    </a-descriptions>
  </a-form>
</template>

<script>
import {defineComponent, reactive, onMounted, inject} from "vue";
import {useRoute} from "vue-router"
// import {ScheduledTaskService} from "@/views/system/scheduledTask/scheduledTask/scheduledTaskService";

export default defineComponent({
  setup() {
    const route = useRoute();
    let routeId = route.params.id;
    let scheduledTaskListApp = inject('scheduledTaskListApp', reactive({}));
    const scheduledTaskModalApp = reactive({id: null, scheduledTask: {}, display: false});

    onMounted(() => {
      scheduledTaskModalApp.scheduledTask = {};
      if (routeId) {
        scheduledTaskModalApp.id = routeId;
      } else if (scheduledTaskListApp.viewModalShowing) {
        scheduledTaskModalApp.scheduledTask = scheduledTaskListApp.task;
        scheduledTaskModalApp.display = true;
      }
      // if (scheduledTaskModalApp.id) {
      //   getInfo(scheduledTaskModalApp.id);
      // }
    })

    // const getInfo = (id) => {
    //   ScheduledTaskService.findScheduledTask(id).then((res) => {
    //     scheduledTaskModalApp.scheduledTask = res.data;
    //     scheduledTaskModalApp.title = "查看 " + scheduledTaskModalApp.scheduledTask.name;
    //   })
    // }

    return {
      scheduledTaskModalApp,
      routeId,
      // getInfo,
    }
  }
})
</script>

<style scoped>
</style>

